package deployment

import (
	"kms-backend/controllers/deployment"

	"github.com/gin-gonic/gin"
)

// 新增
func create(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/create", deployment.Create)
}

// 更新
func update(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/update", deployment.Update)
}

func detail(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.GET("/detail", deployment.Detail)
}

func list(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.GET("/list", deployment.List)
}

func delete(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/delete", deployment.Delete)
}

func deleteList(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/deleteList", deployment.DeleteList)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	deploymentGroup := g.Group("/deployment")
	create(deploymentGroup)
	update(deploymentGroup)
	detail(deploymentGroup)
	list(deploymentGroup)
	delete(deploymentGroup)
	deleteList(deploymentGroup)

}
